package com.source.hotelbath.net;

import android.app.Activity;
import android.app.ProgressDialog;
import android.view.Window;

/**
 * Created by ZhouMeng on 2017/9/27.
 */

public class LoadingDialog {

    private ProgressDialog dialog;

    public LoadingDialog(Activity activity) {
        dialog = new ProgressDialog(activity);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setCanceledOnTouchOutside(false);
        dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        dialog.setMessage("请求网络中...");
    }

    public void showDialog(){
        if (dialog!=null){
            dialog.show();
        }
    }
    public void disDialog() {
        if (dialog != null) {
            dialog.dismiss();
        }
    }
}
